﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sinacor.OMM.DumpEntity
{
    public class DumpType
    {
        public enum Type
        {
            Stream = 0,
            Trace = 1,
            DumpLine = 2,
            Poisoned = 3,
            Unknow = 99
        }

        public static DumpType.Type ConvertFromInt(int intDumpType)
        {
            DumpType.Type ret;

            switch(intDumpType)
            {
                case (int)Type.Stream :
                    ret = DumpType.Type.Stream;
                    break;
                case (int)Type.Trace:
                    ret = DumpType.Type.Trace;
                    break;
                case (int)Type.DumpLine:
                    ret = DumpType.Type.DumpLine;
                    break;
                case (int)Type.Poisoned:
                    ret = DumpType.Type.Poisoned;
                    break;
                default:
                    ret = DumpType.Type.Unknow;
                    break;
            }

            return ret;
        }

        public static int ConvertToInt(DumpType.Type dumpDataType)
        {
            int ret;

            switch (dumpDataType)
            {
                case DumpType.Type.Stream :
                    ret = (int)DumpType.Type.Stream;
                    break;
                case DumpType.Type.Trace:
                    ret = (int)DumpType.Type.Trace;
                    break;
                case DumpType.Type.DumpLine:
                    ret = (int)DumpType.Type.DumpLine;
                    break;
                case DumpType.Type.Poisoned:
                    ret = (int)DumpType.Type.Poisoned;
                    break;
                default:
                    ret = (int)DumpType.Type.Unknow;
                    break;
            }

            return ret;
        }
    }
}
